/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sesion.ejb;

import java.rmi.RemoteException;
import javax.ejb.EJB;
import javax.ejb.EJBException;
import javax.ejb.SessionSynchronization;
import javax.ejb.Stateful;
import javax.interceptor.Interceptors;

/**
 *
 * @author Administrador
 */
@Stateful
@Interceptors(Inter.class)
public class Sesion1Bean implements SessionSynchronization,Sesion1Remote {
@EJB Sesion2Remote s2;
    public void afterBegin() throws EJBException, RemoteException {
        System.out.println("afterBegin1");
    }

    public void beforeCompletion() throws EJBException, RemoteException {
        System.out.println("beforeCompletion1");
    }

    public void afterCompletion(boolean arg0) throws EJBException, RemoteException {
        System.out.println("afterCompletion1");
    }
    
    // Add business logic below. (Right-click in editor and choose
    // "EJB Methods > Add Business Method" or "Web Service > Add Operation")
    public void metodo1(){
        System.out.println("metodo1");
        s2.metodo2();
    }
}
